MOS Technology VIC-II

The VIC-II (Video Interface Chip II), specifically known as the MOS Technology 6567/8562/8564 (NTSC versions), 6569/8565/8566 (PAL), is the microchip tasked with generating Y/C/composite video graphics and DRAM refresh signals in the Commodore 64 and C128 home computers.

Succeeding MOS's original VIC (used in the VIC-20), the VIC-II was one of the two chips mainly responsible for the C64's success (the other chip being the 6581 SID).

Contents

Development history

The VIC-II chip was designed primarily by Al Charpentier and Charles Winterble at MOS Technology, Inc. as a successor to the MOS Technology 6560 "VIC". The team at MOS Technology had previously failed to produce two graphics chips named MOS Technology 6562 for the Commodore TOI computer, and MOS Technology 6564 for the Color PET, due to memory speed constraints.

In order to construct the VIC-II, Charpentier and Winterble made a market survey of current home computers and video games, listing up the current features, and what features they wanted to have in the VIC-II. The idea of adding sprites came from the Texas Instruments TI-99/4A computer and its TMS9918 graphics coprocessor. About 3/4 of the chip surface is used for the sprite functionality.

The chip was partly laid out using electronic design automation tools from Applicon (now a part of UGS Corp.), and partly laid out manually on vellum paper. The design was partly debugged by fabricating chips containing small subsets of the design, which could then be tested separately. This was easy since MOS Technology had both its research and development lab and semiconductor plant at the same location.

The work on the VIC-II was completed in November 1981 while Robert Yannes was simultaneously working on the SID chip. Both chips, like the Commodore 64, were finished in time for the Consumer Electronics Show in the first weekend of January 1982.

VIC-II features

Technical details

Programming

The VIC-II was programmed by manipulating its 47 control registers (up from 16 in the VIC), memory mapped to the range $D000–$D02E in the C64 address space. Of all these registers, 34 dealt exclusively with sprite control (sprites being called MOBs, from Movable Object Blocks, in the VIC-II documentation). Like its predecessor, the VIC-II handled light pen input, and with help from the C64s standard character ROM, provided the original PETSCII character set from 1977 on a similarly dimensioned display as the 40-column PET series.

By reloading the VIC-II's control registers via machine code hooked into the raster interrupt routine (the scanline interrupt), one could program the chip to generate significantly more than 8 concurrent sprites (a process known as sprite multiplexing), and generally give every program-defined slice of the screen different scrolling, resolution and color properties. The hardware limitation of 8 sprites per scanline could be increased further by letting the sprites flicker rapidly on and off. Mastery of the raster interrupt was essential in order to unleash the VIC-II's capabilities. Many demos and some later games would establish a fixed "lock-step" between the CPU and the VIC-II so that the VIC registers could be manipulated at exactly the right moment.

Registers

The VIC-II has 47 read/write registers listed below:

Register Hexadecimal Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Description
0
D000
M0X X Coordinate Sprite 0
1
D001
M0Y Y Coordinate Sprite 0
2
D002
M1X X Coordinate Sprite 1
3
D003
M1Y Y Coordinate Sprite 1
4
D004
M2X X Coordinate Sprite 2
5
D005
M2Y Y Coordinate Sprite 2
6
D006
M3X X Coordinate Sprite 3
7
D007
M3Y Y Coordinate Sprite 3
8
D008
M4X X Coordinate Sprite 4
9
D009
M4Y Y Coordinate Sprite 4
10
D00A
M5X X Coordinate Sprite 5
11
D00B
M5Y Y Coordinate Sprite 5
12
D00C
M6X X Coordinate Sprite 6
13
D00D
M6Y Y Coordinate Sprite 6
14
D00E
M7X X Coordinate Sprite 7
15
D00F
M7Y Y Coordinate Sprite 7
16
D010
M7X8 M6X8 M5X8 M4X8 M3X8 M2X8 M1X8 M0X8 MSBs of X coordinates
17
D011
RST8 ECM BMM DEN RSEL YSCROLL Control register 1
18
D012
RASTER Raster counter
19
D013
LPX Light Pen X
20
D014
LPY Light Pen Y
21
D015
M7E M6E M5E M4E M3E M2E M1E M0E Sprite enabled
22
D016
- - RES MCM CSEL XSCROLL Control register 2
23
D017
M7YE M6YE M5YE M4YE M3YE M2YE M1YE M0YE Sprite Y expansion
24
D018
VM13 VM12 VM11 VM10 CB13 CB12 CB11 - Memory pointers
25
D019
IRQ - - - ILP IMMC IMBC IRST Interrupt register
26
D01A
- - - - ELP EMMC EMBC ERST Interrupt enabled
27
D01B
M7DP M6DP M5DP M4DP M3DP M2DP M1DP M0DP Sprite data priority
28
D01C
M7MC M6MC M5MC M4MC M3MC M2MC M1MC M0MC Sprite multicolor
29
D01D
M7XE M6XE M5XE M4XE M3XE M2XE M1XE M0XE Sprite X expansion
30
D01E
M7M M6M M5M M4M M3M M2M M1M M0M Sprite-sprite collision
31
D01F
M7D M6D M5D M4D M3D M2D M1D M0D Sprite-data collision
32
D020
- - - - EC Border color
33
D021
- - - - B0C Background color 0
34
D022
- - - - B1C Background color 1
35
D023
- - - - B2C Background color 2
36
D024
- - - - B3C Background color 3
37
D025
- - - - MM0 Sprite multicolor 0
38
D026
- - - - MM1 Sprite multicolor 1
39
D027
- - - - M0C Color sprite 0
40
D028
- - - - M1C Color sprite 1
41
D029
- - - - M2C Color sprite 2
42
D02A
- - - - M3C Color sprite 3
43
D02B
- - - - M4C Color sprite 4
44
D02C
- - - - M5C Color sprite 5
45
D02D
- - - - M6C Color sprite 6
46
D02E
- - - - M7C Color sprite 7

Colors

In multicolor bitmap mode (160×200 pixels, which most games used) characters had 4×8 pixels (the characters were still approximately square since the pixels were double width) and 4 colors out of 16 colors. The 4th color was the same for the entire screen (the background color), while the other 3 could be set individually for every such 4×8 pixel area. Two colors were loaded from the active text screen, and the third was loaded from color RAM. Sprites in multicolor mode (12×21 pixels) had three colors: two shared among all sprites and one individual. The artist had to pick shared colors such that the combination with individual colors led to a colorful impression. Some games reloaded shared colors during the raster interrupt; for example, the game Turrican II's underwater area (which was vertically distinct) had different colors. Others, such as Epyx's Summer Games and COMPUTE!'s Gazette's Basketball Sam & Ed, overlaid two high-resolution sprites to allow two foreground colors to be used without sacrificing horizontal resolution [1]. Of course, this technique reduced the number of available sprites by half.

On PAL C64s, the PAL delay line in the monitor or TV which averages the color hue, but not the brightness, of consecutive screen lines can be used to create seven nonstandard colors by alternating screen lines showing two colors of identical brightness. There are seven such pairs of colors in the VIC chip.

The C64's team did not spend much time on mathematically computing the 16 color palette. Robert Yannes, who was involved with the development of the VIC-II, said:

I'm afraid that not nearly as much effort went into the color selection as you think. Since we had total control over hue, saturation and luminance, we picked colors that we liked. In order to save space on the chip, though, many of the colors were simply the opposite side of the color wheel from ones that we picked. This allowed us to reuse the existing resistor values, rather than having a completely unique set for each color. [2]

The 1993 game Mayhem in Monsterland is an example of what can be done if the VIC-II features are used to the maximum. It uses linewise PAL-colorblending, color interlace, a nonstandard way to achieve very fast scrolling and very sophisticated and extremely colorful character-based graphics and very well drawn sprites, some even with hires overlays, to achieve a level of graphical quality that was almost comparable to 16 bit machines of the era.

The VIC-IIe

The 8564/8566 VIC-IIe in the Commodore 128 used 48 pins rather than 40, as it produced more signals, among them the clock for the additional Zilog Z80 CPU of that computer. It also had two extra registers. One for accessing the added numerical keypad and other extra keys of that computer (this function was added to the VIC merely because that proved to be the easiest place in the computer to add the necessary three extra output pins) and the other for toggling between a 1 MHz and a 2 MHz system clock; at the higher speed the VIC-II's video output is merely displaying every second byte in the code as black hires bit-pattern on the screen, suggesting use of the C128's 80-column mode at that speed (via the 8563 VDC RGB chip). Rather unofficially, the two extra registers were also available in the C128's C64 mode, permitting some use of the extra keys, as well as double-speed-no-video execution of CPU-bound code (such as intensive numerical calculations) in self-made C64 programs. The extra registers were also one source of minor incompatibility between the C128's C64 mode and a real C64 - a few older C64 programs inadvertently wrote into the 2 MHz toggle bit, which would do nothing at all on a real C64, but would result in a messed-up display on a C128 in C64 mode.

The VIC-IIe has the little-known ability to create an additional set of colors by manipulating the registers in a specific way that puts the color signal out of phase with what other parts of the chip consider it to be in.

Using the specific behavior of the VIC-IIe's test bit, it is furthermore capable of producing a real interlace picture with a resolution of 320×400 (hires mode) and 160×400 (multicolor mode).

List of VIC-II versions

See also

References

External links


Video/sound chips from MOS Technology and second source/clone vendors

6545 CRTC6560 VIC ● 6567 VIC-II ● 6581 SID7360 TED8563 VDC8568 VDC